<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>事件绑定</title>
</head>

<body>
<!--对b标签进行了鼠标移入和移除事件-->
<b id="b" v-on:mouseover="change" v-on:mouseout="change2">{{name}}</b>   

<script src="js/vue.js"></script>

<script>
    new Vue({
        el:"#b",

        data:{
            name:"鼠标未悬停"
        },

        methods: {
            change(){
                this.name="鼠标悬停"
            },

            change2(){
                this.name="鼠标未悬停"
            }
        },
    });
</script>
</body>
</html>